	//轮播图部分
	var lbt = document.getElementsByClassName('lbt')[0];
	var lbt_img = lbt.getElementsByTagName('img')[0];
	var timer;
	var p = 1;
	var btn = document.getElementsByClassName('btn');
	function lunbotu() {
		timer = setInterval(function() {
			lbt_img.setAttribute('src', './img/' + p + '.jpg');
			for(var i = 0; i < btn.length; i++) {
				btn[i].style.opacity = '0.3';
			}
			btn[p - 1].style.opacity = '0.9';
			p++;
			if(p > 7) {
				p = 1;
			}
		}, 2000)
	}
	lunbotu();
	//	轮播图部分结束

	//	轮播图上左右箭头切换效果
	var turn_left = document.getElementsByClassName('turn_left')[0];
	var turn_right = document.getElementsByClassName('turn_right')[0];
	var k = 1;
	//当鼠标移入轮播图区域让箭头显示
//	lbt.onmouseover = function() {
//		turn_left.style.display = 'block';
//		turn_right.style.display = 'block';
//	}
	//当鼠标移出轮播图区域让箭头隐藏
	//    lbt.onmouseleave = function (){
	//    	turn_left.style.display = 'none';
	//		turn_right.style.display = 'none';
	//    }
	//左边切换
	turn_left.onclick = function() {
		clearInterval(timer);
		lbt_img.setAttribute('src', './img/' + p + '.jpg');
		for(var i = 0; i < btn.length; i++) {
			btn[i].style.opacity = '0.3';
		}
		btn[p - 1].style.opacity = '0.9';
		p--;
		if(p < 1) {
			p = 8;
		}
		lunbotu();
	}
	//右边切换
	turn_right.onclick = function() {
		clearInterval(timer);
		lbt_img.setAttribute('src', './img/' + p + '.jpg');
		for(var i = 0; i < btn.length; i++) {
			btn[i].style.opacity = '0.3';
		}
		btn[p - 1].style.opacity = '0.9';
		p++;
		if(p > 8) {
			p = 1;
		}
		lunbotu();
	}

	//轮播图上左右箭头切换效果结束

	//首页落花瓣效果
	function snowFlow(left, height, src) {
		var hua_box = document.createElement('div');
		var pic = document.createElement('img');
		var snowFlow = document.getElementById('snowFlow');
		pic.className = 'pic';
		hua_box.className = 'hua_box';
		snowFlow.appendChild(hua_box);
		hua_box.appendChild(pic);
		hua_box.style.left = left + 'px';
		hua_box.style.height = height + 'px';
		pic.src = src;
		setTimeout(function() {
			snowFlow.removeChild(hua_box);
		}, 5000);
	}
	setInterval(function() {
		var left = Math.random() * window.innerWidth;
		var height = Math.random() * window.innerHeight;
		var width = Math.random() * 300;
		var src = './img/hua.png';
		snowFlow(left, height, src);
	}, 300)
	//首页落花瓣效果结束

	// 回到顶部按钮
	var toTop = document.getElementsByClassName('toTOP')[0];
	var Top = document.body.scrollTop;
	window.onscroll = function(){
		var Top = document.documentElement.scrollTop || document.body.scrollTop;
		if(Top > 500){
			toTop.style.display = 'block';
		}else{
			toTop.style.display = 'none';
			
		}
		toTop.onclick = function() {
				var timer = setInterval(function(){
					var Top = document.documentElement.scrollTop || document.body.scrollTop;
					if(Top <= 0){
						clearInterval(timer);
					}else{
						document.documentElement.scrollTop = Top - Top/5;
					document.body.scrollTop = Top - Top/10;
					}
					
				},60)
			
			}
		
	}

	//点赞功能实现
	var zan = document.getElementsByClassName('zan')
	var num = document.getElementsByClassName('zan_num');
	var count = [0,0,0,0];
	var arr = []
	for(var i = 0; i < zan.length; i++) {
			(function(i) {
				zan[i].onclick = function() {
//					var date = new Date();
//				    var time= date.getTime();
					zan[i].style.backgroundColor = '#666';
					arr[i] = ++count[i];
//					console.log(arr[i]);
//					localStorage[time] = arr[i];
					num[i].innerText = arr[i] + '人';
				}
			})(i);
		}


